<?php
function callLinuxExtention($domain, $functionName, $aryParam) {
	$domain .= '/';
	$apiCommand = 'CallLinuxExtentionApi.php';
	$serializedParam = serialize ( $aryParam );
	$param = urlencode ( $serializedParam );
	$url = 'http://' . $domain . $apiCommand . '?function=' . $functionName . '&param=' . $param;
	$ch = curl_init ( $url );
	curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, true );
	$c = curl_exec ( $ch );
	$c = unserialize ( $c );
	$paramCount = count ( $aryParam );
	$i = 0;
	while ( $i < $paramCount ) {
		$aryParam [$i] = $c ['params'] [$i];
		$i ++;
	}
	return $c ['result'];
}

/**
 * 以下　単体テストコードブロック
 */
if (PATH_SEPARATOR == ';') {
include_once 'simpletest/unit_tester.php';
include_once 'simpletest/reporter.php';
if (class_exists('UnitTestCase')) {

function testUserFunc2(&$a, &$b) {
	$result = callLinuxExtention ( 'localhost:9060', 'testUserFunc2', array (
			&$a,
			&$b
	) );
	return $result;
}

class callLinuxExtentionTest extends UnitTestCase {

	public function test1000()
	{
		$result = testUserFunc2($a, $b);
		echo $a . ":". $b . ":" . $result;
	}
}
}
}